package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    @Select("select * from shopping_cart")
    List<ShoppingCart> list();

    void add(ShoppingCart shoppingCart);

    List<ShoppingCart> listByClass(ShoppingCart shoppingCart);

    void update(ShoppingCart shoppingCart);

    @Delete("delete from sky_take_out.shopping_cart where user_id = #{userId}")
    void clean(Long userId);


    void deleteByDishIdOr(ShoppingCart shoppingCart);
}
